import { createSlice } from "@reduxjs/toolkit";
const Shorlice = createSlice({
  name: "Shop",
  initialState: {
    //定义数据
    value: 0,
  },
  reducers: {
    //定义方法
    increment: (state) => {
      state.value += 1;
    },
    decrement(state, { payload }) {
      state.value += payload;
    },
  },
});
export let { increment, decrement } = Shorlice.actions;
export default Shorlice.reducer;
